<?php

class Application_Service_UsuarioService extends Application_Service_AbstractService {

    public function __construct() {
        $this->_Model = new Application_Model_Usuario();
    }

    public function insert(array $data) {
        $res = parent::insert($data);
        return $res;
    }

    public function VerificaEMail($email) {
        return $this->_Model->VerificaEMail($email);
    }

    public function SendMail(array $email) {
        $subject = $email["subject"];
        $mailadd = $email["email"];
        $mailto = $email["to"];
        $mailRem = $email["remetente"];
        $mailFrom = $email["from"];
        $mailBody = $email["body"];

        $tr = new Zend_Mail_Transport_Smtp('smtp.eaglesistemas.com.br',
                        array('auth' => 'login',
                            'username' => 'marlon@eaglesistemas.com.br',
                            'password' => 'bia@2208'));

        $mail = new Zend_Mail();

        Zend_Mail::setDefaultTransport($tr);

        $mail->setFrom($mailRem, $mailFrom);
        $mail->setBodyHtml($mailBody);
        $mail->addTo($mailadd, $mailto);
        $mail->setSubject($subject);
        $mail->send();
    }

}
